﻿/*----------------------------------------------------------------
// Copyright (C) 2011 王冲
// 版权所有。 
//
// 文件名：ConyifuPersonnelInfoInfo
// 文件功能描述：洗衣房人事资料业务逻辑层
//
// 
// 创建标识：2012-07-14
//
// 修改标识：
// 修改描述：
//
//
//----------------------------------------------------------------*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using DAO.WaiGaoQiao;

namespace Model.WaiGaoQiao
{
    public class ConyifuPersonnelInfoInfo
    {
        public int PID
        {
            get;
            set;
        }
        public string DeptName
        {
            get;
            set;
        }
        public int DEP_ID
        {
            get;
            set;
        }
        public string EMPNO
        {
            get;
            set;
        }
        public string PName
        {
            get;
            set;
        }
        public string CARDSERIAL
        {
            get;
            set;
        }
        public string BalanceT
        {
            get;
            set;
        }
        public string CARDSTATUS
        {
            get;
            set;
        }
        private DataAccessConyifuPersonnelInfo dar;
        public ConyifuPersonnelInfoInfo()
        {
            dar = new DataAccessConyifuPersonnelInfo();
        }

        /// <summary>
        /// 获取人事信息数量
        /// </summary>
        /// <returns></returns>
        public int GetPersonnelIinformationCount(string where)
        {
            return dar.GetPersonnelIinformationCount(where);
        }

        /// <summary>
        /// 获取部门列表（用于绑定下拉框）
        /// </summary>
        /// <returns></returns>
        public DataSet GetdeptName()
        {
            return dar.GetdeptName();
        }

        /// <summary>
        /// 获取人事信息表
        /// </summary>
        /// <returns></returns>
        public IList<ConyifuPersonnelInfoInfo> SelPersonnelIinformationInfo(int pagesize, int startindex, string strquery)
        {
            IList<ConyifuPersonnelInfoInfo> perlist = new List<ConyifuPersonnelInfoInfo>();
            ConyifuPersonnelInfoInfo perinfo;
            DataSet ds = dar.SelPersonnelIinformationInfo(pagesize, startindex, strquery);
            foreach (DataRow item in ds.Tables[0].Rows)
            {
                perinfo = new ConyifuPersonnelInfoInfo()
                {
                    PID = Convert.ToInt32(item["PID"]),
                    DeptName = item["DeptName"].ToString(),
                    EMPNO = item["EMPNO"].ToString(),
                    PName = item["PName"].ToString(),
                    CARDSERIAL = item["卡序列号"].ToString(),
                    BalanceT = item["库内余额"].ToString(),
                    CARDSTATUS = item["卡状态"].ToString()
                };
                perlist.Add(perinfo);
            }
            return perlist;
        }
    }
}
